package Reference;

/**
 * @Author: dch
 * @Date: 2020/5/18 13:54
 * @Description:强引用(死了都不回收)
 */
public class StrongReferenceDemo {
    public static void main(String[] args) {
        Object obj1 = new Object();//这样定义默认为强引用
        Object obj2 = obj1;//obj2引用赋值
        obj1 = null;//置空
        System.gc();
        System.out.println(obj2);//输出 java.lang.Object@65b3120a
    }
}
